package com.zb.entity.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @Author WEN
 * @Date 2023/7/10 0010
 **/
@Data
@ApiModel("角色封装")
public class RoleDto {
    @ApiModelProperty(value = "角色ID，新增不必传，修改时必传")
    private Long id;
    @NotBlank(message = "角色名称不能为空")
    @Length(max = 10, message = "角色名称字符长度限制在10个以内")
    @ApiModelProperty(value = "角色名称", required = true)
    private String name;

    @NotBlank(message = "角色编码不能为空")
    @Length(max = 60, message = "角色编码限制60个字符以内")
    @Pattern(regexp = "^\\w+$", message = "角色编码仅匹配英文字符！")
    @ApiModelProperty(value = "角色编码")
    private String code;

    @NotNull(message = "角色状态不能为空")
    @ApiModelProperty(value = "角色状态：false-否，true-是", required = true)
    private boolean disabled = false;
}
